import request from "@/utils/request";
import store from "@/store";

const BASE_URL = 'topic'

export const getAll = () => {
    return request.get(`${BASE_URL}/getAll`)
}

export const getByUserId = (id: string) => {
    return request.get(`${BASE_URL}/${id}`)
}

export const insert = (content: string , id: string) => {
    let form = new FormData();
    form.set("userId" , id)
    form.set("content" , content)
    return request.post(`${BASE_URL}/insert` , form)
}